package com.github.baichuan.file.rest.config;

import com.github.baichuan.utils.SnowFlake;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Base64;

@Configuration
public class Component {
    @Bean
    public Base64.Decoder base64Decoder(){
        return Base64.getDecoder();
    }

    @Bean
    public Base64.Encoder base64Encoder(){
        return Base64.getEncoder();
    }

    @Bean
    public SnowFlake snowFlake(){
        return SnowFlake.DEFAULT;
    }

//    @Bean
//    public MessageDigest md5() throws NoSuchAlgorithmException {
//        return MessageDigest.getInstance("MD5");
//    }
}
